[SPARK-58036][SQL] Delegate missing methods in AggregatedDialect to underlying dialects#57193
Open
marcuslin123 wants to merge 1 commit into
Open
[SPARK-58036][SQL] Delegate missing methods in AggregatedDialect to underlying dialects#57193marcuslin123 wants to merge 1 commit into
marcuslin123 wants to merge 1 commit into
Conversation
…nderlying dialects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Add missing method overrides in
AggregatedDialectthat delegate to the underlying dialects, fixing cases where the genericJdbcDialectdefault is used instead of the database-specific implementation.Methods now properly delegated:
compileValue— the reported bug (Oracle timestamps formatted incorrectly)compileExpression— SQL expression pushdownisSupportedFunction— function pushdown support (returns true if any dialect supports it)getJdbcSQLQueryBuilder— SQL query buildersupportsLimit/supportsOffset/supportsHint/supportsJoin— query capability flagsgetLimitClause/getOffsetClause— SQL clause generationclassifyException— error classificationrenameTable— DDL generationfunctions— custom SQL functionscreateConnectionFactory— connection creationWhy are the changes needed?
When a user registers a custom JDBC dialect alongside a built-in one (e.g., Oracle), Spark combines them into an
AggregatedDialect. However,AggregatedDialectonly delegated ~11 methods to the underlying dialects — the rest fell through to the genericJdbcDialectdefaults. This caused database-specific behavior (like Oracle's timestamp literal formatting) to be silently dropped, producing invalid SQL.Does this PR introduce any user-facing change?
Yes. Users with custom JDBC dialects registered alongside built-in dialects will now get correct database-specific SQL generation for all delegated methods, instead of generic defaults that may produce invalid SQL.
How was this patch tested?
Added a new test "Aggregated dialects: delegation of compileValue and other methods" in
JDBCSuite.scalathat verifiescompileValue,isSupportedFunction,supportsLimit,supportsOffset,getLimitClause, andgetOffsetClauseare properly delegated through the aggregated dialect.Was this patch authored or co-authored using generative AI tooling?
Generative AI tooling (Claude Code) was used as an assistive tool for implementation guidance.